import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Member from '../views/Member.vue'
import Shopcar from '../views/Shopcar.vue'
import Search from '../views/Search.vue'
import PhotosList from '../components/Photos/PhotoList.vue'
import PhotosInfo from '../components/Photos/Info.vue'
import GoodsList from '../components/Goods/GoodsList.vue'
import GoodsDetail from '../components/Goods/GoodsDetail.vue'
import GoodsDesc from '../components/Goods/GoodsDesc.vue'
import GoodsComment from '../components/Goods/GoodsComment.vue'
import NewsList from '../components/News/NewsList.vue'
import NewsDetail from '../components/News/Detail.vue'
import Add from '../components/Add.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    redirect: '/home'
  },
  { path: '/home', component: Home },
  { path: '/member', component: Member },
  { path: '/shopcar', component: Shopcar },
  { path: '/search', component: Search },
  { path: '/newslist', component: NewsList },
  { path: '/news/detail/:id', component: NewsDetail },
  { path: '/photo/list', component: PhotosList },
  { path: '/photo/info/:id', component: PhotosInfo },
  { path: '/goods/list', component: GoodsList },
  { path: '/goods/detail/:id', component: GoodsDetail },
  { path: '/goods/goodsdesc/:id', component: GoodsDesc },
  { path: '/goodscomments/:id', component: GoodsComment },
  { path: '/addgoods', component: Add }
]

const router = new VueRouter({
  routes
})

export default router
